package utils

import (
	"net/smtp"
	"strings"
)

func SendToMail(to, code string) error {
	user := "3034221968@qq.com"
	password := "jlmtdjjbjmjadcid"
	host := "smtp.qq.com:456"
	hp := strings.Split(host, ":")
	auth := smtp.PlainAuth("", user, password, hp[0])

	msg := []byte("您的验证码为" + code)
	send_to := strings.Split(to, ";")
	err := smtp.SendMail(host, auth, user, send_to, msg)
	return err
}
